this notebook intends to provide a map representation of information DC bikeshare ridership. In particular, am interested in … where are stations, how they align with
library(gbfs)
Warning: package ‘gbfs’ was built under R version 4.3.2
library(here)
library(janitor)
library(tidyverse)
library(openmeteo)
library(lubridate)
library(sf) # working with simple features - geospatial
Warning: package ‘sf’ was built under R version 4.3.2Linking to GEOS 3.11.2, GDAL 3.7.2, PROJ 9.3.0; sf_use_s2() is TRUE
library(tmap)
Warning: package ‘tmap’ was built under R version 4.3.2Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
remotes::install_github('r-tmap/tmap')
library(tidycensus)
Warning: package ‘tidycensus’ was built under R version 4.3.2
df1= st_read(here("raw_data",
"Crime_Incidents_in_2022.geojson")) %>%
clean_names()
Reading layer `Crime_Incidents_in_2022' from data source
`D:\ds\raw_data\Crime_Incidents_in_2022.geojson' using driver `GeoJSON'
Simple feature collection with 27137 features and 23 fields
Geometry type: POINT
Dimension: XY
Bounding box: xmin: -77.11364 ymin: 38.81467 xmax: -76.91002 ymax: 38.99491
Geodetic CRS: WGS 84
tmap_mode("view")
tmap mode set to interactive viewing
tm_shape(df1)+
tm_facets("offense")+
tm_dots("offense", legend.show = FALSE)